package com.jinglu.cloud.security.model;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.Collection;

/**
 * @Author lvzhenzhao
 * @Datetime 2021/03/02-下午3:28
 */
@Data
public class AuthInfo implements Serializable, UserDetails {

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 员工工号
     */
    private String number;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 密码
     */
    private String password;


    /**
     * 电话
     */
    private String mobilePhone;

    /**
     * 角色编码
     */
    private String roleCode;

    /**
     * 登录token
     */
    private String token;

    /**
     * 过期时间(秒)
     */
    private String expire;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return userName;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
